package com.Questions.doublePointer;


import java.util.List;

/**
 * 链表的中间结点
 */
public class leetcode876 {
    public ListNode middleNode(ListNode head) {
        ListNode s=head;
        ListNode f=head;
        while (f.next!=null){
            s=s.next;
            f=f.next;
            if(f.next!=null){
                f=f.next;
            }
        }
        return s;
    }
}
